package com.plugin.view

import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.Gravity
import android.widget.LinearLayout
import com.example.plugin_native.R
import com.support.utils.dp

/**
 * Create： zhangjunfei 1/28/21 2:23 PM
 * 描述：地图mark点
 */
@SuppressLint("ViewConstructor")
class PointMarkView(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0,
    var iconId: Int = R.drawable.icon_location,
    var viewWidth: Int = 35,
    var viewHeight: Int = 35
) : LinearLayout(context, attrs, defStyleAttr) {
    init {
        gravity = Gravity.CENTER
        setBackgroundResource(iconId)
    }

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        setMeasuredDimension(viewWidth.dp, viewHeight.dp)
    }
}